﻿from fonetik import *
import unittest

class FonetikUnitTest(unittest.TestCase):
	def setUp(self):
		self.f = Fonetik()

class CapitalizationNormalization(FonetikUnitTest):
	words = (	("FOO","fo"),
				("Foo","fo"),
				("FoO","fo"),
			)
	def testCapitalizationIsNoMatter(self):
		for input,output in self.words:
			result = self.f.translate(input)
			self.assertEqual(result,output)
	

class SpecialCharaters(FonetikUnitTest):
	
	words = (	("Salchichón","salchichon"),
				("Jamón","jamon"),
				("Strüdel","strudel"),
				("carrona","Carroña"))
	
	def testIfSpecialCharactersAreAllowed(self):
		for word1,word2 in self.words:
			result1 = self.f.translate(word1)
			result2 = self.f.translate(word2)
			self.assertEqual(result1,result2)
class FonetikTester():
	def __init__(self):
		self.f = Fonetik()
			
	def run(self):
		unittest.main()

def main():
	ft = FonetikTester()
	ft.run()



main()
